﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using olierFrm.Security;
using olierFrm.Extensions.EString;

namespace olierFrm.WebFormDev
{
    public class Account
    {
        public const string Prefix = "SAMS";
        public static string UserPassword(string UserName, string Password)
        {
            string text = "SAMS" + UserName + "&" + Password;
            text = text.ToUpper().ToMD5Hash();
            return StringExtensions.Slice(text.Substring(23), 0, -1).ToUpper();
        }
        public static string UserRole(string UserName, string RoleID)
        {
            string text = "SAMS" + UserName + "&" + RoleID;
            text = text.ToUpper().ToMD5Hash();
            return StringExtensions.Slice(text.Substring(23), 0, -1).ToUpper();
        }
    }
}
